package com.ovo.chatRobot.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ovo.chatRobot.entity.UserInfo;
import com.ovo.chatRobot.service.BaseUserService;

@Controller
@RequestMapping("/user")
public class UserController {
	@Autowired
	private BaseUserService userService;

	@RequestMapping("/showUser")
	@ResponseBody
	public UserInfo toIndex(HttpServletRequest request, Model model) {
		int userId = Integer.parseInt(request.getParameter("id"));
		UserInfo user = this.userService.getUserById(userId);
		return user;
	}
}
